Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by mail3.access.digex.net (8.8.4/8.8.4) with ESMTP
id LAA05787 for <mcox@access.digex.net>; Sat, 11 Jan 1997 11:40:01 -0500 (EST)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.4/8.8.4)
id JAA27130 for amos-out; Sat, 11 Jan 1997 09:02:33 -0500 (EST)
Received: from mail2.access.digex.net (mail2.access.digex.net [205.197.247.3])
by svcs1.digex.net (8.8.4/8.8.4) with ESMTP
id JAA27127 for <amos-list@svcs1.digex.net>; Sat, 11 Jan 1997 09:02:32 -0500 (EST)
Received: from golden.net (root@golden.org [199.166.210.2])
by mail2.access.digex.net (8.8.4/8.8.4) with ESMTP
id JAA22022 for <amos-list@access.digex.net>; Sat, 11 Jan 1997 09:02:31 -0500 (EST)
Received: from golden.net (Giark@cisco3-174.golden.net [207.6.168.174]) by golden.net (8.8.2/8.6.12) with SMTP id JAA01970 for <amos-list@access.digex.net>; Sat, 11 Jan 1997 09:02:23 -0500 (EST)
From: "Mr. Giark To You" <joehick@golden.net>
To: AMOS List <amos-list@access.digex.net>
Date: Sat, 11 Jan 1997 09:01:19 -0500
Message-ID: <yam6950.986.4755208@pop.golden.net>
In-Reply-To: <191.6949T711T713@satech.net.au>
X-Mailer: YAM 1.3.3 - Amiga Mailer by Marcel Beck
Subject: Re: cd32 pad
MIME-Version: 1.0
Content-Type: text/plain
Status: RO
X-Status:
On 10-Jan-97, Jasonn wrote:
>Anyone out there know how to read a cd32 control pad thru amos, ie to find
>out the direction the user is pushing and what buttons??
AMOS With The CD32
by
C. Edward Stewart
(joehick@golden.net)
(IRC: Giark)
Whether or not you happen to have a CD32, you may have access to a CD32
joypad. With it, you have the option of programming a lot more neat options
(because it has a lot of buttons). There have been several different
programs out there to read the CD32 joypad, but they all lack in one way or
another. Here's my procedure that does it:
Procedure PAD
CD=0 : CD32=0
Lib Open 1,"lowlevel.library",40
Dreg(0)=1
CD=Lib Call(1,-30)
Lib Close 1
If CD and 1 Then CD32=CD32+%1
If CD and 2 Then CD32=CD32+%10
If CD and 4 Then CD32=CD32+%100
If CD and 8 Then CD32=CD32+%1000
If CD and 131072 Then CD32=CD32+%10000
If CD and 262144 Then CD32=CD32+%100000
If CD and 524288 Then CD32=CD32+%1000000
If CD and 1048576 Then CD32=CD32+%10000000
If CD and 2097152 Then CD32=CD32+%100000000
If CD and 4194304 Then CD32=CD32+%1000000000
If CD and 8388608 Then CD32=CD32+%10000000000
End Proc[CD32]
To use this procedure, you'll need to get the lowlevel.library (and a CD32
joypad) if you don't have it. Now, the procedure is nice, but without the
code to use it, it's just so many cool AMOS commands.
Do
PAD=0
PAD : PAD=Param
If PAD and 1 Then PAD_RIGHT
If PAD and 2 Then PAD_LEFT
If PAD and 4 Then PAD_DOWN
If PAD and 8 Then PAD_UP
If PAD and 16 Then PAD_PAUSE
If PAD and 32 Then PAD_REWIND
If PAD and 64 Then PAD_FASTFORWARD
If PAD and 128 Then PAD_GREEN
If PAD and 256 Then PAD_YELLOW
If PAD and 512 Then PAD_RED
If PAD and 1024 Then PAD_BLUE
Loop
This loop checks all the buttons and acts on them. If you want different
buttons to be sensed sooner, move them up on the list. I've got all the
different buttons labeled as procedures, but you could use Goto's or
commands just as easily. The code above just shows you what values
represent which buttons.
Most CD32s don't have keyboards attached, so don't put places in your
program for users to type unless you use some sort of CD32 joypad procedure
to get the characters. Say something like the one below.